1. Field of the Invention
The present invention relates to the field of display tables, such as HTML tables. More particularly, the invention relates to a system and method for efficient layout of a display table.
2. Description of the Related Art
Display tables are commonly used in many types of software applications. A display table may comprise rows and columns that define cells. Each of the cells may comprise some type of cell content. For example, many current web page documents include hypertext markup language (HTML) tables with cells that may include content such as text or images. As another example, word processor applications often enable authors to create tables for display in a document.
Display tables are typically described in some format that a software application must process in order to display the table correctly. For example, a markup language table may be described in a text format by various markup language tags that are processed and used to create data structures representing the table.
When processing a table description, many factors may be involved in correctly determining the dimensions for the rows and columns of the table, such as the desired dimensions indicated by the table author, the available display device area for displaying the table, the minimum cell size necessary to display the content of each cell, the number of columns or rows spanned by particular cells, the determination of row and column dimensions for any nested tables included in the table, etc. The process of determining the row and column dimensions for a table, assigning coordinates to the table, and positioning the cell content within each cell of the table is referred to herein as xe2x80x9claying outxe2x80x9d the table.
In many cases, it is of course not only desirable to correctly lay out display tables, but to do so efficiently. Designing an efficient table layout method may be difficult. One source of difficulty lies in dealing with nested tables, i.e., a table with one or more cells comprising another table. If the table layout method is not designed carefully, the method may scale exponentially with increasing table nesting complexity.
Although some current table layout methods do succeed in avoiding exponential scaling with increased nesting complexity, it appears, based on the results of benchmark tests, that they do not perform other possible optimizations. Although thorough optimization of a table layout method may not be very important in some contexts or environments, in others it can be important.
Small footprint devices offer one example of an environment in which it is often necessary or desirable to pay particular attention to software efficiency. The field of xe2x80x9csmartxe2x80x9d small footprint devices is growing and changing rapidly. Small footprint devices include handheld computers, personal data assistants (PDAs), cellular phones, global positioning system (GPS) receivers, game consoles, set-top boxes, and many more such devices. Small footprint devices are becoming increasingly powerful and enabled to run software applications or services historically associated with general computing devices, such as desktop computers.
Small footprint devices may have very strong resource constraints, such as the amount of memory and the processing power available. Thus, it is often necessary or desirable to design optimized software that performs well in the environment of a small footprint device. Providing an efficient layout method for a display table is one example of a software optimization that may significantly benefit small footprint device users. For example, many small footprint devices are now able to run web browser applications, which often process web pages comprising markup language tables, such as HTML tables, as described above.
The problems outlined above may in large part be solved by a system and method for efficient layout of a display table, as described herein. Given a description of a table, such as a markup language description, the table description may be parsed and data structures representing the table description may be created.
The table description data structures may then be xe2x80x9cinspectedxe2x80x9d, in order to determine the possible size of the table. The process of table inspection may involve determining the minimum and maximum possible widths for each table cell, and then determining the minimum and maximum possible widths for each table column, based on the individual cell values. The minimum and maximum possible table widths may then be calculated from the possible table column widths.
Once the table has been inspected, the table may then be xe2x80x9capportionedxe2x80x9d, based on the results of the inspection step. That is, final dimensions may be assigned to the table. The process of table apportioning may involve assigning a width to each table column and a height to each table row.
The table coordinates may then be xe2x80x9cnormalizedxe2x80x9d, which may involve converting relative table coordinates into absolute coordinates.
Table layout optimizations are described, e.g., in order to efficiently handle various aspects of table layout, such as table cells that span multiple columns or rows, table cells that include nested tables, etc. Thus, the table layout method described herein may be well-suited for use in an environment in which software optimizations are necessary or desirable, such as within a resource-constrained small footprint device.